<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<base href='<?php echo base_url()?>'>
<link rel="stylesheet" type="text/css" href="public/common/css/common.css"/>
<link rel="stylesheet" type="text/css" href="public/admin/css/admin.css"/>
<script type="application/javascript" src="public/common/js/jquery.js"></script>
<script>
$(function(){
	$('.table tr').hover(function(){
		$(this).children('td').css('background','#ccffcc');
	},function(){
		$(this).children('td').css('background','white');
	});	
	select_all();
});
function select_all()
{
	$('.table').find('input:checkbox').attr('checked',true);
}
function select_other()
{
	check_obj = $('.table').find('input:checked');
	$('.table').find('input:checkbox').attr('checked',true);
	check_obj.attr('checked',false);
}

</script>
</head>
<body>
	<div class="body">
    	<?php echo $this->position->get_position();?>
        <div class="body_center">
			<form action="<?php echo site_url('admin/backup/do_backup')?>" method="post">
        	<table class="table" style="margin-bottom:0px;">
            	<tr><th>选择</th><th>表名</th><th>记录数</th><th>使用空间</th><th>更新时间</th></tr>
				<?php if($tables === FALSE):?>
				<tr><td colspan="5" align="center">没有任何表</td></tr>
				<?php else:?>
				<?php foreach($tables->result() as $value):?>
                <tr>
					<td align="center"><input type="checkbox" name='table_name[]' value="<?php echo $value->TABLE_NAME?>"></td>
					<td align="center"><?php echo $value->TABLE_NAME?></td>
					<td align="center"><?php echo $value->TABLE_ROWS?></td>
					<td align="center"><?php echo $value->DATA_SIZE?></td>
					<td align="center"><?php echo $value->UPDATE_TIME?></td>
                </tr>
                <?php endforeach;?>
				<tr>
                	<td colspan="5" align="right">
                    	<input type="button" value="全选" class="button" onclick="select_all()">
                        <input type="button" value="反选" class="button" onclick="select_other()">
                 	</td>
                </tr>
				<?php endif;?>
            </table>
        </div>
        <div class="page">
			<input type="submit" class="submit" value="备份" /> &nbsp;&nbsp;
			<input type="reset" class="reset" value="重置" />
		</div>
		</form>
    </div>
</body>
</html>